﻿#region Usings

using System.Text;

#endregion

namespace Rail.Net.Services
{
    public class ServiceHelper
    {
        public static string ConvertToUtf8(string toBeConverted)
        {
            var iso88591 = Encoding.GetEncoding("iso-8859-1");
            var utf8 = Encoding.UTF8;

            var isoBytes = iso88591.GetBytes(toBeConverted);
            var utf8Bytes = Encoding.Convert(iso88591, utf8, isoBytes);

            return utf8.GetString(utf8Bytes);
        }
    }
}